import { defineStore } from "pinia";
import { bannerGet } from "../api/prod";
interface BannerType {
  desc: string;
  objectId: string;
  link: string;
  poster: string;
}
interface BannerStateType {
  list: Array<BannerType>;
}
export const useBanner = defineStore("banner", {
  state: (): BannerStateType => ({
    list: [],
  }),
  actions: {
    async initBanner() {
      let res = await bannerGet();
      this.list = res.data.results;
    },
  },
});
